﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;

namespace SBS
{
    public class Scooter
    {
        private string regNr;
        private string model;
        private int maerkeNr;
        private int aar;
        private double antKM;
        private DateTime sidsteService;
        private Certifikat certifikat;
        /// <summary>
        /// Metode til OpretScooter
        /// </summary>
        public Scooter(string regNr, string model, int maerkeNr, int aar, double antKM)
        {
            this.regNr = regNr;
            this.model = model;
            this.maerkeNr = maerkeNr;
            this.aar = aar;
            this.antKM = antKM;
        }
        /// <summary>
        /// Opretter Scooter objekt med tilknyttet Certifikat objekt
        /// </summary>
        /// <param name="regNr"></param>
        /// <param name="SidsteService"></param>
        /// <param name="aar"></param>
        /// <param name="antKM"></param>
        /// <param name="CertNr"></param>
        /// <param name="CertNavn"></param>
        /// <param name="model"></param>
        public Scooter(string regNr, DateTime SidsteService, int aar, double antKM,int CertNr,string CertNavn, string model)
        {
            this.regNr = regNr;
            this.sidsteService = SidsteService;
            this.model = model;
            
            this.aar = aar;
            this.antKM = antKM;
            certifikat = new Certifikat(CertNr,CertNavn);
        }

        public Scooter(string regNr, DateTime SidsteService,int CertNr, string CertNavn, string model)
        {
            this.regNr = regNr;
            this.sidsteService = SidsteService;
            this.model = model;

            
            certifikat = new Certifikat(CertNr, CertNavn);
        }

       

        public Scooter()
        {

        }
        public string RegNr
        {
            get
            {
                return regNr;
            }
            set
            {
            }
        }

        public string Model
        {
            get
            {
                return model;
            }
            set
            {
                model = value;
            }
        }

       

        
        public double AntKm
        {
            get
            {
                return antKM;
            }
            set
            {
                antKM = value;
            }
        }
        public int Aar
        {
            get { return aar; }
            set { aar = value; }
        }

        public DateTime SidsteService
        {
            get
            {
                return sidsteService;
            }
            set
            {
                sidsteService = value;
            }
        }

        public Certifikat Certifikat
        {
            get
            {
                return certifikat;
            }
            set
            {
            }
        }
        public static bool TilfojScooter(int Knr, Scooter S)
        {
            return DB.TilfojScooter(Knr, S);
        }

        public override string ToString()
        {
            return string.Format("Reg. Nr:".PadRight(15) + this.regNr + "\nModel:".PadRight(16)+this.model);
        }
        
    }
}
